//
//  TCLYIntegralGoodsCollectionViewCell.m
//  YuErmuYing
//
//  Created by LYang on 16/9/2.
//  Copyright © 2016年 Tiancheng. All rights reserved.
//

#import "TCLYIntegralGoodsCollectionViewCell.h"
#import "Macros.h"
#import "Masonry.h"

@implementation TCLYIntegralGoodsCollectionViewCell
-(instancetype) initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.goodsImageView = [[UIImageView alloc] init];
        [self addSubview:self.goodsImageView];
        [self.goodsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(10);
            make.left.mas_equalTo(self.mas_left).offset(40);
            make.right.mas_equalTo(self.mas_right).offset(-40);
            make.height.mas_equalTo(120/667.0*screenHeight);
        }];
        self.nameLabel = [[UILabel alloc] init];
        self.nameLabel.textColor = blackFont;
        self.nameLabel.textAlignment = NSTextAlignmentLeft;
        self.nameLabel.font = [UIFont systemFontOfSize:12];
        [self addSubview:self.nameLabel];
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.goodsImageView.mas_bottom).offset(6);
            make.left.mas_equalTo(self.mas_left).offset(6);
            make.right.mas_equalTo(self.mas_right).offset(-6);
            make.height.mas_equalTo(20);
        }];
        self.introduceLabel = [[UILabel alloc] init];
        self.introduceLabel.textColor = grayFont;
        self.introduceLabel.textAlignment = NSTextAlignmentLeft;
        self.introduceLabel.font = [UIFont systemFontOfSize:12];
        [self addSubview:self.introduceLabel];
        [self.introduceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(0);
            make.left.mas_equalTo(self.nameLabel);
            make.right.mas_equalTo(self.nameLabel);
            make.height.mas_equalTo(20);
        }];
        self.priceLabel = [[UILabel alloc] init];
        self.priceLabel.textColor = btnColor;
        self.priceLabel.textAlignment = NSTextAlignmentLeft;
        self.priceLabel.font = [UIFont systemFontOfSize:12];
        [self addSubview:self.priceLabel];
        [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.introduceLabel.mas_bottom).offset(-6);
            make.left.mas_equalTo(self.mas_left).offset(6);
            make.height.mas_equalTo(20);
            make.width.mas_equalTo(80/375.0*screenWidth);
        }];
        
        self.numLabel = [[UILabel alloc] init];
        self.numLabel.textColor = blackFont;
        self.numLabel.font = [UIFont systemFontOfSize:12];
        self.numLabel.textAlignment = NSTextAlignmentRight;
        [self addSubview:self.numLabel];
        [self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.priceLabel);
            make.right.mas_equalTo(self.mas_right).offset(-6);
            make.height.mas_equalTo(20);
            make.left.mas_equalTo(self.priceLabel.mas_right).offset(0);
        }];
    }
    return self;
}
@end
